#define _CRT_SECURE_NO_WARNINGS 1

class Solution
{
public:
    bool CheckPermutation(string s1, string s2)
    {
        int hash[26] = { 0 };
        for (auto ch : s1)
        {
            hash[ch - 'a']++;
        }

        for (auto ch : s2)
        {
            --hash[ch - 'a'];
        }

        for (int i = 0; i < 26; i++)
        {
            if (hash[i] != 0) return false;
        }

        return true;
    }
};